package cn.gmy.day0721_JavaIO;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class BufferedInputStreamOne {	
	
	/**
	 * ���������ǽ������������ڹܵ�����������һ��ܵ�!
	 */
	public static void main(String[] args) {		
		try {
			/**
			 * ��һ���������ĸ���ͼ���������!
			 */			
			FileInputStream fis = new FileInputStream("D:/dat.txt");
			BufferedInputStream bis = new BufferedInputStream(fis);		
			
			int c = 0;
			System.out.print((char)bis.read());//�ȶ�һ���ֽ�
			System.out.print((char)bis.read());//�ֶ���һ���ֽ�
			
			for(int i = 0; i < 10 && (c = bis.read()) != -1; i++) {
				System.out.print((char)c + " ");
			}
			bis.close();//���������Ĺܵ��ر��ˣ�����Ĺܵ�ͳͳ�رյ�!
		} catch (IOException e) {
			System.out.println("�Ҳ���ָ���ļ�");
			System.exit(-1);
		}
	}
}
